package panda.natalia.gothread.suspend;

import com.sun.xml.internal.bind.v2.model.core.EnumLeafInfo;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * a simple framework of java fiber
 *
 * @Author: scpanda2007
 * @Date: 2019/12/4 11:13
 */

@Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface Instrumented {
    String FIELD_NAME_METHOD_OPTIMIZED = "methodOptimized";
    boolean methodOptimized() default false;
    String FIELD_NAME_SUSPENDABLE_CALL_SITES = "suspendableCallSites";
    int[] suspendableCallSites() default {}; // in source lines
    String FIELD_NAME_METHOD_START = "methodStart";
    int methodStart() default -1; // the source line of the start of the method
    String FIELD_NAME_METHOD_END = "methodEnd";
    int methodEnd() default -1; // the source line of the end of the method
    String FIELD_NAME_SUSPENDABLE_CALL_SITE_NAMES = "suspendableCallSiteNames";
    String[] suspendableCallSitesNames() default {};
    String FIELD_NAME_SUSPENDABLE_CALL_SITES_OFFSETS_AFTER_INSTR = "suspendableCallSitesOffsetsAfterInstr";
    int[] suspendableCallSitesOffsetsAfterInstr() default {}; // in bci
}
